//namespace ContosoUniversity.Domain.Core.Repository.Projections.Factories
//{
//    using System.Linq;
//    using Models;
//    using NRepository.Core.Query;
//    using NRepository.Samples.Core;
//    using Services.QueryServices;

//    public class StudentDetailFactoryQuery : FactoryQuery<StudentDetail>
//    {
//        public override IQueryable<object> Query(IQueryRepository repository, object additionalQueryData)
//        {
//            // new EagerLoadingQueryStrategy<Student>(p => p.Enrollments.Select(p1 => p1.Course)
//            var students = repository.GetEntities<Student>()
//                .Select(student => new StudentDetail
//                {
//                    StudentId = student.ID,
//                    EnrollmentDate = student.EnrollmentDate,
//                    FirstMidName = student.FirstMidName,
//                    LastName = student.LastName,
//                    EnrollmentDetails = student.Enrollments.Select(enrollment => new StudentDetail.EnrollmentDetail
//                    {
//                        CourseTitle = enrollment.Course.Title,
//                        Grade = enrollment.Grade
//                    })
//                });

//            return students;
//        }
//    }
//}
